package Day14;

import java.util.HashMap;
import java.util.Scanner;

/**
 * Creat with IntelliJ IDEA
 * Description
 * User: mamba24
 * Date: 2022-09-26
 * Time: 22:54
 * To BE A Better Person-2020-3-2
 */
public class TestDemo {
    //判断是否是闰年
    //能被4整除，但是不能被100整除的年份
    //比如2020年
    //2.能被400整除的年份
    //比如2000年
    public static boolean isLeapYear(int Year){
        if((Year%4==0 && Year%100!=0) || Year%400==0){
            return true;
        }
        return false;
    }
    public static void main(String[] args) {
        HashMap<Integer,Integer> map=new HashMap<>();
        map.put(1,31);
        map.put(3,31);
        map.put(4,30);
        map.put(5,31);
        map.put(6,30);
        map.put(7,31);
        map.put(8,31);
        map.put(9,30);
        map.put(10,31);
        map.put(11,30);
        map.put(12,31);
        Scanner sc=new Scanner(System.in);

        int Year=sc.nextInt();
        int Mon=sc.nextInt();
        int Day=sc.nextInt();
        int days=Day;
        boolean lep=isLeapYear(Year);
        if (Mon > 2){
            if (lep){
                days+=29;
            }else{
                days+=28;
            }

        }
        for (int i = Mon-1; i > 2 ; i--) {
            days+=map.get(i);
        }
        if(Mon>1){
            days+=31;
        }
        System.out.println(days);
    }
}
